//
//  ViewController.m
//  Demo-002-
//
//  Created by 王奎卿 on 2017/5/8.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "ViewController.h"
#import "DemoView.h"

@interface ViewController ()
{
    DemoView *demoView;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self showDemoView];
}

- (void)showDemoView
{
//    demo(demoView).frame = self.view.bounds;
    
    demoView = [[DemoView alloc]initWithFrame:self.view.bounds];
    
    self.view = demoView;
    
    UIButton *btn = ({
    
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        
        btn.frame = CGRectMake(0, 0, 40, 40);
        
        [btn setTitle:@"点击" forState:0];
        
        [btn addTarget:self action:@selector(clickBtn) forControlEvents:UIControlEventTouchUpInside];
        
        btn;
    });
    
//    [demoView.tableView addSubview:btn];
    
    printf("%s", __func__);
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(clickBtn)];
}

- (void)clickBtn
{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
